﻿using System;
using System.ComponentModel;
using System.Runtime.InteropServices;
using Teigha.Core;

namespace Teigha.TD
{
	public class OdDbDatabaseSummaryInfo : OdRxObject
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public OdDbDatabaseSummaryInfo(IntPtr cPtr, bool cMemoryOwn) : base(TD_DbPINVOKE.OdDbDatabaseSummaryInfo_SWIGUpcast(cPtr), cMemoryOwn)
		{
			this.swigCPtr = new HandleRef(this, cPtr);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static HandleRef getCPtr(OdDbDatabaseSummaryInfo obj)
		{
			if (obj != null)
			{
				return obj.swigCPtr;
			}
			return new HandleRef(null, IntPtr.Zero);
		}

		~OdDbDatabaseSummaryInfo()
		{
			this.Dispose();
		}

		public override void Dispose()
		{
			if (this.swigCPtr.Handle != IntPtr.Zero)
			{
				if (this.swigCMemOwn)
				{
					lock (this.locker)
					{
						if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
						{
							this.swigCMemOwn = false;
							TD_DbPINVOKE.delete_OdDbDatabaseSummaryInfo(this.swigCPtr);
						}
					}
					this.swigCMemOwn = false;
				}
				this.swigCPtr = new HandleRef(null, IntPtr.Zero);
			}
			GC.SuppressFinalize(this);
			base.Dispose();
		}

		public new static OdDbDatabaseSummaryInfo cast(OdRxObject pObj)
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = TD_DbPINVOKE.OdDbDatabaseSummaryInfo_cast(OdRxObject.getCPtr(pObj));
			OdDbDatabaseSummaryInfo result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdDbDatabaseSummaryInfo)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdDbDatabaseSummaryInfo)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdDbDatabaseSummaryInfo)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new static OdRxClass desc()
		{
			OdRxClass result = (OdRxClass)Teigha.Core.Helpers.odrxCreateObjectInternal(TD_DbPINVOKE.OdDbDatabaseSummaryInfo_desc(), false);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual OdRxClass isA()
		{
			OdRxClass result = (OdRxClass)Teigha.Core.Helpers.odrxCreateObjectInternal(TD_DbPINVOKE.OdDbDatabaseSummaryInfo_isA(this.swigCPtr), false);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual OdRxObject queryX(OdRxClass protocolClass)
		{
			OdRxObject result = Teigha.Core.Helpers.odrxCreateObjectInternal(TD_DbPINVOKE.OdDbDatabaseSummaryInfo_queryX(this.swigCPtr, OdRxClass.getCPtr(protocolClass)), false);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public static OdDbDatabaseSummaryInfo createObject()
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = TD_DbPINVOKE.OdDbDatabaseSummaryInfo_createObject();
			OdDbDatabaseSummaryInfo result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdDbDatabaseSummaryInfo)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdDbDatabaseSummaryInfo)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdDbDatabaseSummaryInfo)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual string getTitle()
		{
			string result = TD_DbPINVOKE.OdDbDatabaseSummaryInfo_getTitle(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setTitle(string title)
		{
			TD_DbPINVOKE.OdDbDatabaseSummaryInfo_setTitle(this.swigCPtr, title);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual string getSubject()
		{
			string result = TD_DbPINVOKE.OdDbDatabaseSummaryInfo_getSubject(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setSubject(string subject)
		{
			TD_DbPINVOKE.OdDbDatabaseSummaryInfo_setSubject(this.swigCPtr, subject);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual string getAuthor()
		{
			string result = TD_DbPINVOKE.OdDbDatabaseSummaryInfo_getAuthor(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setAuthor(string author)
		{
			TD_DbPINVOKE.OdDbDatabaseSummaryInfo_setAuthor(this.swigCPtr, author);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual string getKeywords()
		{
			string result = TD_DbPINVOKE.OdDbDatabaseSummaryInfo_getKeywords(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setKeywords(string keywords)
		{
			TD_DbPINVOKE.OdDbDatabaseSummaryInfo_setKeywords(this.swigCPtr, keywords);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual string getComments()
		{
			string result = TD_DbPINVOKE.OdDbDatabaseSummaryInfo_getComments(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setComments(string comments)
		{
			TD_DbPINVOKE.OdDbDatabaseSummaryInfo_setComments(this.swigCPtr, comments);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual string getLastSavedBy()
		{
			string result = TD_DbPINVOKE.OdDbDatabaseSummaryInfo_getLastSavedBy(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setLastSavedBy(string lastSavedBy)
		{
			TD_DbPINVOKE.OdDbDatabaseSummaryInfo_setLastSavedBy(this.swigCPtr, lastSavedBy);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual string getRevisionNumber()
		{
			string result = TD_DbPINVOKE.OdDbDatabaseSummaryInfo_getRevisionNumber(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setRevisionNumber(string revisionNumber)
		{
			TD_DbPINVOKE.OdDbDatabaseSummaryInfo_setRevisionNumber(this.swigCPtr, revisionNumber);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual string getHyperlinkBase()
		{
			string result = TD_DbPINVOKE.OdDbDatabaseSummaryInfo_getHyperlinkBase(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setHyperlinkBase(string hyperlinkBase)
		{
			TD_DbPINVOKE.OdDbDatabaseSummaryInfo_setHyperlinkBase(this.swigCPtr, hyperlinkBase);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual int numCustomInfo()
		{
			int result = TD_DbPINVOKE.OdDbDatabaseSummaryInfo_numCustomInfo(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void addCustomSummaryInfo(string key, string value)
		{
			TD_DbPINVOKE.OdDbDatabaseSummaryInfo_addCustomSummaryInfo(this.swigCPtr, key, value);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual void deleteCustomSummaryInfo(int fieldIndex)
		{
			TD_DbPINVOKE.OdDbDatabaseSummaryInfo_deleteCustomSummaryInfo__SWIG_0(this.swigCPtr, fieldIndex);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual bool deleteCustomSummaryInfo(string key)
		{
			bool result = TD_DbPINVOKE.OdDbDatabaseSummaryInfo_deleteCustomSummaryInfo__SWIG_1(this.swigCPtr, key);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void getCustomSummaryInfo(int fieldIndex, ref string key, ref string value)
		{
			IntPtr intPtr = Marshal.StringToCoTaskMemUni(key);
			IntPtr value2 = intPtr;
			IntPtr intPtr2 = Marshal.StringToCoTaskMemUni(value);
			IntPtr value3 = intPtr2;
			try
			{
				TD_DbPINVOKE.OdDbDatabaseSummaryInfo_getCustomSummaryInfo__SWIG_0(this.swigCPtr, fieldIndex, ref intPtr, ref intPtr2);
				if (TD_DbPINVOKE.SWIGPendingException.Pending)
				{
					throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
				}
			}
			finally
			{
				if (intPtr != value2)
				{
					key = Marshal.PtrToStringUni(intPtr);
				}
				if (intPtr2 != value3)
				{
					value = Marshal.PtrToStringUni(intPtr2);
				}
			}
		}

		public virtual void setCustomSummaryInfo(int fieldIndex, string key, string value)
		{
			TD_DbPINVOKE.OdDbDatabaseSummaryInfo_setCustomSummaryInfo__SWIG_0(this.swigCPtr, fieldIndex, key, value);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual bool getCustomSummaryInfo(string customInfoKey, ref string value)
		{
			IntPtr intPtr = Marshal.StringToCoTaskMemUni(value);
			IntPtr value2 = intPtr;
			bool result;
			try
			{
				bool flag = TD_DbPINVOKE.OdDbDatabaseSummaryInfo_getCustomSummaryInfo__SWIG_1(this.swigCPtr, customInfoKey, ref intPtr);
				if (TD_DbPINVOKE.SWIGPendingException.Pending)
				{
					throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
				}
				result = flag;
			}
			finally
			{
				if (intPtr != value2)
				{
					value = Marshal.PtrToStringUni(intPtr);
				}
			}
			return result;
		}

		public virtual void setCustomSummaryInfo(string customInfoKey, string value)
		{
			TD_DbPINVOKE.OdDbDatabaseSummaryInfo_setCustomSummaryInfo__SWIG_1(this.swigCPtr, customInfoKey, value);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual OdDbDatabase database()
		{
			OdDbDatabase result = (OdDbDatabase)Teigha.Core.Helpers.odrxCreateObjectInternal(TD_DbPINVOKE.OdDbDatabaseSummaryInfo_database(this.swigCPtr), false);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual void setDatabase(OdDbDatabase pDb)
		{
			TD_DbPINVOKE.OdDbDatabaseSummaryInfo_setDatabase(this.swigCPtr, OdDbDatabase.getCPtr(pDb));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		private object locker = new object();

		private HandleRef swigCPtr;
	}
}
